package com.leoman.dao;

import com.leoman.entity.CompanyUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 企业用户
 * Created by Administrator on 2016/10/18 0018 下午 3:02.
 */
public interface CompanyUserDao extends JpaRepository<CompanyUser, Integer>, JpaSpecificationExecutor<CompanyUser> {

    @Query("select a from CompanyUser a where a.createTime >= ?1")
    List<CompanyUser> findListByCreateTime(Long createTime);

    @Query("select a from CompanyUser a where a.checkStatus = 0 and a.sendTime >= ?1")
    List<CompanyUser> findListNoCheckByCreateTime(Long createTime);

    @Query("select a from CompanyUser a where a.mobile = ?1")
    CompanyUser findOneByMobile(String mobile);
}